package com.hong.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hong.domain.Classes;
import com.hong.dto.QueryClassesDTO;
import com.hong.service.ClassesService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;

/**
* (classes)表控制层
*
* @author xxxxx
*/
@Api(value ="班级",tags = {"班级"})
@RestController
@RequestMapping("/classes")
public class ClassesController {
/**
* 服务对象
*/
    @Autowired
    private ClassesService classesService;

    /**
    * 通过主键查询单条数据
    *
    * @param id 主键
    * @return 单条数据
    */
    @GetMapping("selectOne")
    public Classes selectOne(Integer id) {
    return classesService.selectByPrimaryKey(id);
    }

    @GetMapping("page")
    @ApiOperation("分页")
    public Page<Classes> getPage(QueryClassesDTO param){
       return   classesService.getPage(param);
    }

}
